import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/inspec/plan_associated_tasks_entity.dart';

PlanAssociatedTasksEntity $PlanAssociatedTasksEntityFromJson(Map<String, dynamic> json) {
  final PlanAssociatedTasksEntity planAssociatedTasksEntity = PlanAssociatedTasksEntity();
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    planAssociatedTasksEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    planAssociatedTasksEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    planAssociatedTasksEntity.createDate = createDate;
  }
  final int? dangerNum = jsonConvert.convert<int>(json['dangerNum']);
  if (dangerNum != null) {
    planAssociatedTasksEntity.dangerNum = dangerNum;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    planAssociatedTasksEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    planAssociatedTasksEntity.id = id;
  }
  final int? lateNum = jsonConvert.convert<int>(json['lateNum']);
  if (lateNum != null) {
    planAssociatedTasksEntity.lateNum = lateNum;
  }
  final int? numberOfTasksToBeCompleted = jsonConvert.convert<int>(json['numberOfTasksToBeCompleted']);
  if (numberOfTasksToBeCompleted != null) {
    planAssociatedTasksEntity.numberOfTasksToBeCompleted = numberOfTasksToBeCompleted;
  }
  final String? planId = jsonConvert.convert<String>(json['planId']);
  if (planId != null) {
    planAssociatedTasksEntity.planId = planId;
  }
  final int? reExaminationNum = jsonConvert.convert<int>(json['reExaminationNum']);
  if (reExaminationNum != null) {
    planAssociatedTasksEntity.reExaminationNum = reExaminationNum;
  }
  final String? riskObjectId = jsonConvert.convert<String>(json['riskObjectId']);
  if (riskObjectId != null) {
    planAssociatedTasksEntity.riskObjectId = riskObjectId;
  }
  final String? riskObjectName = jsonConvert.convert<String>(json['riskObjectName']);
  if (riskObjectName != null) {
    planAssociatedTasksEntity.riskObjectName = riskObjectName;
  }
  final String? riskUnitId = jsonConvert.convert<String>(json['riskUnitId']);
  if (riskUnitId != null) {
    planAssociatedTasksEntity.riskUnitId = riskUnitId;
  }
  final String? riskUnitName = jsonConvert.convert<String>(json['riskUnitName']);
  if (riskUnitName != null) {
    planAssociatedTasksEntity.riskUnitName = riskUnitName;
  }
  final String? taskId = jsonConvert.convert<String>(json['taskId']);
  if (taskId != null) {
    planAssociatedTasksEntity.taskId = taskId;
  }
  final int? taskNum = jsonConvert.convert<int>(json['taskNum']);
  if (taskNum != null) {
    planAssociatedTasksEntity.taskNum = taskNum;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    planAssociatedTasksEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    planAssociatedTasksEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    planAssociatedTasksEntity.updateDate = updateDate;
  }
  return planAssociatedTasksEntity;
}

Map<String, dynamic> $PlanAssociatedTasksEntityToJson(PlanAssociatedTasksEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['dangerNum'] = entity.dangerNum;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['lateNum'] = entity.lateNum;
  data['numberOfTasksToBeCompleted'] = entity.numberOfTasksToBeCompleted;
  data['planId'] = entity.planId;
  data['reExaminationNum'] = entity.reExaminationNum;
  data['riskObjectId'] = entity.riskObjectId;
  data['riskObjectName'] = entity.riskObjectName;
  data['riskUnitId'] = entity.riskUnitId;
  data['riskUnitName'] = entity.riskUnitName;
  data['taskId'] = entity.taskId;
  data['taskNum'] = entity.taskNum;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension PlanAssociatedTasksEntityExtension on PlanAssociatedTasksEntity {
  PlanAssociatedTasksEntity copyWith({
    String? createBy,
    String? createById,
    String? createDate,
    int? dangerNum,
    String? deleted,
    String? id,
    int? lateNum,
    int? numberOfTasksToBeCompleted,
    String? planId,
    int? reExaminationNum,
    String? riskObjectId,
    String? riskObjectName,
    String? riskUnitId,
    String? riskUnitName,
    String? taskId,
    int? taskNum,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return PlanAssociatedTasksEntity()
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..dangerNum = dangerNum ?? this.dangerNum
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..lateNum = lateNum ?? this.lateNum
      ..numberOfTasksToBeCompleted = numberOfTasksToBeCompleted ?? this.numberOfTasksToBeCompleted
      ..planId = planId ?? this.planId
      ..reExaminationNum = reExaminationNum ?? this.reExaminationNum
      ..riskObjectId = riskObjectId ?? this.riskObjectId
      ..riskObjectName = riskObjectName ?? this.riskObjectName
      ..riskUnitId = riskUnitId ?? this.riskUnitId
      ..riskUnitName = riskUnitName ?? this.riskUnitName
      ..taskId = taskId ?? this.taskId
      ..taskNum = taskNum ?? this.taskNum
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
